package at.ac.tuwien.isis.infret.helper;


import weka.core.Instance;

public class DocumentContainer implements Comparable
{
	private String classname;
	private String documentname;
	private Instance attributes;
	private String id; 
	
	public DocumentContainer(String classname, String documentname,
			Instance attributes) {
		super();
		this.classname = classname;
		if(documentname.contains("/"))
			this.documentname = documentname.split("/")[1];
		else
			this.documentname = documentname;
		this.attributes = attributes;
		this.id = this.documentname+":"+this.classname;//+":"//+Arrays.toString(this.attributes.toDoubleArray());
	}
	

	public String getClassname() {
		return classname;
	}

	public void setClassname(String classname) {
		this.classname = classname;
	}

	public String getDocumentname() {
		return documentname;
	}

	public void setDocumentname(String documentname) {
		this.documentname = documentname;
	}
	public void setAttributes(Instance attributes){
		this.attributes = attributes;
	}
	public Instance getAttributes(){
		return this.attributes;
	}
	public boolean equals(Object o){
		//System.out.println("test");
		if (o instanceof DocumentContainer && 
				((DocumentContainer)o).getDocumentname().equals(this.documentname))
			return true;
		return false;
	}
	public String toString(){
		return this.id;
	}


	@Override
	public int compareTo(Object o) {
		//System.out.println("+");
		
		return this.toString().compareTo(o.toString());
	}
}
